var module = angular.module('nogyeadmin.scheduleContent', []);
module.service('AlertService', ['$rootScope', '$timeout', function ($rootScope, $timeout) {
    $rootScope.alerts = [];
    var service = {
        closeAlert: function (index) {
            $rootScope.alerts.splice(index, 1);
        },
        addAlert: function (msg, timeout) {
            $rootScope.alerts.push(msg);
            $timeout(function () {
                $rootScope.alerts.splice($rootScope.alerts.indexOf(alert), 1);
            }, timeout);
        }
    };
    return service;
}]);
